@tooltip: ~'w-tooltip';
@tooltip-bg: rgba(0, 0, 0, 0.75);

.@{tooltip} {
  position: relative;
  display: inline-block;
  &-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
  }
  &-inner {
    font-size: 12px;
    max-width: 250px;
    padding: 5px 10px;
    display: block;
    color: #fff;
    text-align: left;
    text-decoration: none;
    background-color: @tooltip-bg;
    border-radius: 4px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
    word-break: break-all; 
  }

  &.right &-arrow,
  &.rightTop &-arrow,
  &.rightBottom &-arrow {
    border-right-color: @tooltip-bg;
    border-width: 5px 5px 5px 0;
    left: 0;
    margin-top: -5px;
    top: 50%;
  }

  &.left &-arrow,
  &.leftTop &-arrow,
  &.leftBottom &-arrow {
    border-left-color: @tooltip-bg;
    border-width: 5px 0 5px 5px;
    margin-top: -5px;
    right: 0;
    top: 50%;
  }
  &.leftTop &-arrow,
  &.rightTop &-arrow {
    top: 15px;
  }
  &.leftBottom &-arrow,
  &.rightBottom &-arrow {
    bottom: 10px;
    top: auto;
  }

  &.top &-arrow,
  &.topLeft &-arrow,
  &.topRight &-arrow {
    border-top-color: @tooltip-bg;
    border-width: 5px 5px 0;
    bottom: 0;
    left: 50%;
    margin-left: -5px;
  }

  &.bottom &-arrow,
  &.bottomLeft &-arrow,
  &.bottomRight &-arrow {
    border-bottom-color: @tooltip-bg;
    border-width: 0 5px 5px;
    left: 50%;
    margin-left: -5px;
    top: 0;
  }
  &.bottomLeft &-arrow,
  &.topLeft &-arrow {
    left: 15px;
  }
  &.bottomRight &-arrow,
  &.topRight &-arrow {
    right: 10px;
    left: auto;
  }

  &.bottom,
  &.bottomLeft,
  &.bottomRight {
    padding-top: 5px;
  }
  &.top,
  &.topLeft,
  &.topRight {
    padding-bottom: 5px;
  }
  &.right,
  &.rightTop,
  &.rightBottom {
    padding-left: 5px;
  }
  &.left,
  &.leftTop,
  &.leftBottom {
    padding-right: 5px;
  }

  &.no-arrow {
    padding: 0 !important;
  }
}
